import os
import sys

import django

# 1. 伪造，让Django启动
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "order_platform.settings")
django.setup()

from utils.encrypt import md5
from web import models

# 2. 写入数据
models.Administrator.objects.create(
    username='root',
    password=md5('root'),
    mobile='18688868867',
)
